from tortoise import BaseDBAsyncClient


async def upgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `student` MODIFY COLUMN `sno` VARCHAR(11) NOT NULL COMMENT '学号';
        ALTER TABLE `teacher` MODIFY COLUMN `num` VARCHAR(11) NOT NULL COMMENT '编号';
        ALTER TABLE `user` MODIFY COLUMN `num` VARCHAR(11) NOT NULL COMMENT '账号';"""


async def downgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `user` MODIFY COLUMN `num` VARCHAR(10) NOT NULL COMMENT '账号';
        ALTER TABLE `student` MODIFY COLUMN `sno` VARCHAR(10) NOT NULL COMMENT '学号';
        ALTER TABLE `teacher` MODIFY COLUMN `num` VARCHAR(10) NOT NULL COMMENT '编号';"""
